<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>添加管理员账户</title>
</head>
<style type="text/css">
    body{
        background: url(image/add_bg.jpg);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        min-height: 500px;
        padding-top: 100px;
    }
    label{
      font-weight: bold;
    }
    input[type="text"]{
      width: 20%;
      height:25px;
      margin-left:5px;
      padding-left:10px;
    }
    input[type="button"]{
      width: 10%;
      height: 32px;
    }

</style>
<body style="background-color:#FFF;">
     <center>
         <span>账号：</span><input type="text" name="account" id="account"/>
         <span>密码：</span><input type="text" name="password" id="password"/>
         <span>角色：</span><input type="text" name="role" id="role"/>
         <input type="button" value="添加" id="submit">
    </center>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="../public/js/serverIp.js"></script>
<script type="text/javascript">
     
   $(function(){
          $("#submit").click(function(){
              var datastr="account="+$("#account").val()+"&password="+$("#password").val()+"&role="+$("#role").val();
               $.post("Scauaie.com/user/addaccount",datastr,function(data){
                    var dataobj=JSON.parse(data);
                     if(dataobj.bool=="true"){
                        if(confirm("添加成功，留在本页面？")){
                           var href=window.location.href;
                           window.location.href=href;
                        }else{
                           window.location.href="content_mag.html";
                        }
                     }else{
                       alert("发表失败，请重新尝试.")                          
                     } 
               },"html")
             
})
</script>
</body>   
</html>